package com.megvii.koala.data.manager;

import com.megvii.koala.data.bean.CompanyBean;
import com.megvii.koala.data.bean.UserInfoBean;

import java.util.Arrays;

/**
 * Created by linyue on 16/3/9.
 */
public class CompanyManager extends KoalaBeanManager<CompanyBean>
{
    @Override
    protected void update(CompanyBean bean, boolean sortAndIndex)
    {
        if (bean != null)
        {
            bean.logo = makeUrl(bean.logo);
            Arrays.sort(bean.door_weekdays);
        }
        super.update(bean, sortAndIndex);
    }

    public CompanyBean getCompany()
    {
        if (this.isEmpty())
        {
            return null;
        }
        else
        {
            return beanList.get(0);
        }
    }
}
